package com.flitsneak.designpatterns.behavioralpatterns.delegate;

import com.flitsneak.designpatterns.behavioralpatterns.delegate.concrete.LickDogA;
import com.flitsneak.designpatterns.behavioralpatterns.delegate.concrete.LickDogB;
import com.flitsneak.designpatterns.behavioralpatterns.delegate.concrete.LickDogC;

import java.util.HashMap;
import java.util.Map;

/**
 * @author flitsneak
 * @email flitsneak@gmail.com
 * @date 2022/7/15 16:27
 * @description
 */
public class ReceiverFeiFei implements LickDog {

    private Map<String, LickDog> lickDogMap = new HashMap<>(6);

    public ReceiverFeiFei() {
        lickDogMap.put("cocky buttocks", new LickDogA());
        lickDogMap.put("big breasts", new LickDogB());
        lickDogMap.put("slim", new LickDogC());
    }

    @Override
    public void lick(String preference) {
        if (!lickDogMap.containsKey(preference)) {
            System.out.println("没有适配的舔狗！");
            return;
        }
        lickDogMap.get(preference).lick(preference);
    }
}
